import request from '@/utils/request'

// 查询零件采购列表
export function listPurchase(query) {
  return request({
    url: '/part/purchase/list',
    method: 'get',
    params: query
  })
}

// 查询零件采购详细
export function getPurchase(id) {
  return request({
    url: '/part/purchase/' + id,
    method: 'get'
  })
}

// 查询零件信息
export function getPartsInfoByIds(orderDetailpartNos) {
  return request({
    url: '/part/purchase/partInfo/' + orderDetailpartNos,
    method: 'get'
  })
}

// 新增零件采购
export function addPurchase(data) {
  return request({
    url: '/part/purchase',
    method: 'post',
    data: data
  })
}

// 修改零件采购
export function updatePurchase(data) {
  return request({
    url: '/part/purchase',
    method: 'put',
    data: data
  })
}

// 删除零件采购
export function delPurchase(id) {
  return request({
    url: '/part/purchase/' + id,
    method: 'delete'
  })
}
